#!/bin/sh
# Start/stop/restart the Abaxd server:

if [ "$1" = "stop" ]; then
  echo -n "Stopping Abaxd ... "
  killall -9 abaxd.php > /dev/null 2>&1
elif [ "$1" = "restart" ]; then
  echo -n "Restarting Abaxd ... "
  killall -9 abaxd.php > /dev/null 2>&1
  sleep 1
  abaxd.php >> /var/log/asterisk/abaxd.log 2>&1 &
else
  echo -n "Starting Abaxd ... "
  abaxd.php >> /var/log/asterisk/abaxd.log 2>&1 &
fi

echo Ok
